<?php /* Smarty version 2.6.31, created on 2018-03-26 17:30:09
         compiled from E:/xampp/htdocs/rbac/Admin/Tpl/Article/edit.html */ ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => '../Common/head_article.html', 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
<body>
<div class="container-fluid">
    <form action="" method="post" enctype="multipart/form-data">
        <div class="col-sm-12 col-md-12 col-lg-12" style="margin-top: 20px;">
            <p class="article-title">文章标题</p>
            <input value="<?php echo $this->_tpl_vars['oldData']['title']; ?>
" name="title" type="text" class="form-control" placeholder="请输入文章标题" required/>
        </div>
        <div class="col-sm-12 col-md-12 col-lg-12 article-item-top">
            <p class="article-title">所属分类</p>
            <select name="category_cid" class="form-control" required>
                <option value="">--请选择分类--</option>
                <?php $_from = ($this->_tpl_vars['cateData']); if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['v']):
?>
                    <option <?php if ($this->_tpl_vars['oldData']['category_cid'] == $this->_tpl_vars['v']['cid']): ?> selected="selected" <?php endif; ?> value="<?php echo $this->_tpl_vars['v']['cid']; ?>
"><?php echo $this->_tpl_vars['v']['cname']; ?>
</option>
                <?php endforeach; endif; unset($_from); ?>
            </select>
        </div>
        <div class="col-sm-12 col-md-12 col-lg-12 article-item-top">
            <p class="article-title">摘要</p>
            <textarea name="digest" class="form-control quit-drag" placeholder="请输入文章摘要"><?php echo $this->_tpl_vars['oldData']['digest']; ?>
</textarea>
        </div>
        <div class="col-sm-12 col-md-12 col-lg-12 article-item-top" id="thumb-box">
            <p class="article-title">图片</p>
            <?php if (! empty ( $this->_tpl_vars['oldData']['thumb'] )): ?>
                <img src="<?php echo $this->_tpl_vars['oldData']['thumb']; ?>
" height="100"/>&nbsp;
                <a href="#" id="img-del" style="color: red;font-weight: 700;text-decoration: none;font-size: 18px;"><span class="glyphicon glyphicon-remove"></span></a>
            <?php else: ?>
                <input name="thumb" id="thumb" type="file"/>
            <?php endif; ?>
        </div>
        <div class="col-sm-12 col-md-12 col-lg-12 article-item-top">
            <p class="article-title">内容</p>
            <textarea name="content" class="form-control quit-drag" placeholder="请输入文章内容" required rows="20"><?php echo $this->_tpl_vars['oldData']['content']; ?>
</textarea>
        </div>
        <input type="hidden" name="thumb" value="<?php echo $this->_tpl_vars['oldData']['thumb']; ?>
"/>
        <input type="hidden" name="aid" value="<?php echo $_GET['aid']; ?>
"/>
        <div class="col-sm-12 col-md-12 col-lg-12" style="margin-top: 15px;">
            <button class="btn btn-primary" type="submit">确 定</button>
            <a class="btn btn-warning" href="javascript:history.go(-1)">返 回</a>
        </div>
    </form>
</div>
<?php echo '
    <script type="text/javascript">
        $(\'#img-del\').click(function(){
            $(\'input[name=thumb]\').val(\'\');
            var str = \'<p class="article-title">图片</p><input name="thumb" id="thumb" type="file"/>\';
            $(\'#thumb-box\').html(str);
        })
    </script>
'; ?>

</body>
</html>